\(\int \frac {1-x^2}{1+4 x^2+x^4} \, dx\) [82]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 44 \[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=\frac {\arctan \left (\frac {x}{\sqrt {2-\sqrt {3}}}\right )}{\sqrt {2}}-\frac {\arctan \left (\frac {x}{\sqrt {2+\sqrt {3}}}\right )}{\sqrt {2}} \]

[Out]

1/2*arctan(x/(1/2*6^(1/2)-1/2*2^(1/2)))*2^(1/2)-1/2*arctan(x/(1/2*6^(1/2)+1/2*2^(1/2)))*2^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {1177, 209} \[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=\frac {\arctan \left (\frac {x}{\sqrt {2-\sqrt {3}}}\right )}{\sqrt {2}}-\frac {\arctan \left (\frac {x}{\sqrt {2+\sqrt {3}}}\right )}{\sqrt {2}} \]

[In]

Int[(1 - x^2)/(1 + 4*x^2 + x^4),x]

[Out]

ArcTan[x/Sqrt[2 - Sqrt[3]]]/Sqrt[2] - ArcTan[x/Sqrt[2 + Sqrt[3]]]/Sqrt[2]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 1177

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - a*e^2, 0] && GtQ[b^2
 - 4*a*c, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \left (-1-\sqrt {3}\right ) \int \frac {1}{2+\sqrt {3}+x^2} \, dx+\frac {1}{2} \left (-1+\sqrt {3}\right ) \int \frac {1}{2-\sqrt {3}+x^2} \, dx \\ & = \frac {\tan ^{-1}\left (\frac {x}{\sqrt {2-\sqrt {3}}}\right )}{\sqrt {2}}-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {2+\sqrt {3}}}\right )}{\sqrt {2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.86 \[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=\frac {-\left (\left (-3+\sqrt {3}\right ) \sqrt {2+\sqrt {3}} \arctan \left (\frac {x}{\sqrt {2-\sqrt {3}}}\right )\right )-\sqrt {2-\sqrt {3}} \left (3+\sqrt {3}\right ) \arctan \left (\frac {x}{\sqrt {2+\sqrt {3}}}\right )}{2 \sqrt {3}} \]

[In]

Integrate[(1 - x^2)/(1 + 4*x^2 + x^4),x]

[Out]

(-((-3 + Sqrt[3])*Sqrt[2 + Sqrt[3]]*ArcTan[x/Sqrt[2 - Sqrt[3]]]) - Sqrt[2 - Sqrt[3]]*(3 + Sqrt[3])*ArcTan[x/Sq
rt[2 + Sqrt[3]]])/(2*Sqrt[3])

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.80

method result size
risch \(-\frac {\sqrt {2}\, \arctan \left (\frac {x \sqrt {2}}{2}\right )}{2}+\frac {\sqrt {2}\, \arctan \left (\frac {x^{3} \sqrt {2}}{2}+\frac {3 x \sqrt {2}}{2}\right )}{2}\) \(35\)
default \(-\frac {\sqrt {3}\, \left (\sqrt {3}+3\right ) \arctan \left (\frac {2 x}{\sqrt {6}+\sqrt {2}}\right )}{3 \left (\sqrt {6}+\sqrt {2}\right )}-\frac {\left (-3+\sqrt {3}\right ) \sqrt {3}\, \arctan \left (\frac {2 x}{\sqrt {6}-\sqrt {2}}\right )}{3 \left (\sqrt {6}-\sqrt {2}\right )}\) \(70\)

[In]

int((-x^2+1)/(x^4+4*x^2+1),x,method=_RETURNVERBOSE)

[Out]

-1/2*2^(1/2)*arctan(1/2*x*2^(1/2))+1/2*2^(1/2)*arctan(1/2*x^3*2^(1/2)+3/2*x*2^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.70 \[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=\frac {1}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (x^{3} + 3 \, x\right )}\right ) - \frac {1}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) \]

[In]

integrate((-x^2+1)/(x^4+4*x^2+1),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*arctan(1/2*sqrt(2)*(x^3 + 3*x)) - 1/2*sqrt(2)*arctan(1/2*sqrt(2)*x)

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.95 \[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=- \frac {\sqrt {2} \cdot \left (2 \operatorname {atan}{\left (\frac {\sqrt {2} x}{2} \right )} - 2 \operatorname {atan}{\left (\frac {\sqrt {2} x^{3}}{2} + \frac {3 \sqrt {2} x}{2} \right )}\right )}{4} \]

[In]

integrate((-x**2+1)/(x**4+4*x**2+1),x)

[Out]

-sqrt(2)*(2*atan(sqrt(2)*x/2) - 2*atan(sqrt(2)*x**3/2 + 3*sqrt(2)*x/2))/4

Maxima [F]

\[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=\int { -\frac {x^{2} - 1}{x^{4} + 4 \, x^{2} + 1} \,d x } \]

[In]

integrate((-x^2+1)/(x^4+4*x^2+1),x, algorithm="maxima")

[Out]

-integrate((x^2 - 1)/(x^4 + 4*x^2 + 1), x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.59 \[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=\frac {1}{4} \, \sqrt {2} {\left (\pi \mathrm {sgn}\left (x\right ) - 2 \, \arctan \left (\frac {\sqrt {2} {\left (x^{2} + 1\right )}}{2 \, x}\right )\right )} \]

[In]

integrate((-x^2+1)/(x^4+4*x^2+1),x, algorithm="giac")

[Out]

1/4*sqrt(2)*(pi*sgn(x) - 2*arctan(1/2*sqrt(2)*(x^2 + 1)/x))

Mupad [B] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.70 \[ \int \frac {1-x^2}{1+4 x^2+x^4} \, dx=\frac {\sqrt {2}\,\left (\mathrm {atan}\left (\frac {\sqrt {2}\,x^3}{2}+\frac {3\,\sqrt {2}\,x}{2}\right )-\mathrm {atan}\left (\frac {\sqrt {2}\,x}{2}\right )\right )}{2} \]

[In]

int(-(x^2 - 1)/(4*x^2 + x^4 + 1),x)

[Out]

(2^(1/2)*(atan((3*2^(1/2)*x)/2 + (2^(1/2)*x^3)/2) - atan((2^(1/2)*x)/2)))/2